$(document).ready(function(){
	$(document).on('change','#MaNhomNhapDiem',function(e){
		e.preventDefault();
		var btn = $(this);
		var mamon=$(this).val();
		var url ="ajax_nhapdiem.php";
		var manhom=$("#MaNhomNhapDiem").val();
		param ={'manhom':manhom};
		
		var img = "<img src='images/ajax_loading.gif' />"
			$.ajax({
				url : url,
				data: param,
				type: "POST",
				dataType: "HTML",
				error: function(){},
				beforeSend: function(){
					
					$('#danhsachlopnhapdiem').html(img);
					
				},
				complete:function(){
					
				},
				success: function(data){
					$('#danhsachlopnhapdiem').html(data);
				
				}
	});
		
	});
	$(document).on('keyup','#diem',function(e){
		e.preventDefault();
		var btn = $(this);
		var mamon=$(this).val();
		var url ="ajax_nhapdiem.php";
		var manhom=$("#MaNhomNhapDiem").val();
		var masv=$(this).data('mssv');
		var thanhtich=$(this).val();
		param ={'manhom':manhom,'thanhtich':thanhtich,'btnsua':true,'mssv':masv};
		
		var img = "<img src='images/ajax_loading.gif' />"
			$.ajax({
				url : url,
				data: param,
				type: "POST",
				dataType: "HTML",
				error: function(){},
				beforeSend: function(){
					
					
					
				},
				complete:function(){
					
				},
				success: function(data){
				
				
				}
	});
		
	});
	
	$(document).on('keyup','#nhanxet',function(e){
		e.preventDefault();
		var btn = $(this);
		var mamon=$(this).val();
		var url ="ajax_nhapdiem.php";
		var manhom=$("#MaNhomNhapDiem").val();
		var masv=$(this).data('mssv');
		var nhanxet=$(this).val();
		param ={'manhom':manhom,'nhanxet':nhanxet,'btnsuanx':true,'mssv':masv};
		
		var img = "<img src='images/ajax_loading.gif' />"
			$.ajax({
				url : url,
				data: param,
				type: "POST",
				dataType: "HTML",
				error: function(){},
				beforeSend: function(){
					
					
					
				},
				complete:function(){
					
				},
				success: function(data){
				
				
				}
	});
		
	});
	
	$(document).on('keyup','#thuong',function(e){
		e.preventDefault();
		var btn = $(this);
		var mamon=$(this).val();
		var url ="ajax_nhapdiem.php";
		var manhom=$("#MaNhomNhapDiem").val();
		var masv=$(this).data('mssv');
		var thuong=$(this).val();
		param ={'manhom':manhom,'thuong':thuong,'btnsuat':true,'mssv':masv};
		
		var img = "<img src='images/ajax_loading.gif' />"
			$.ajax({
				url : url,
				data: param,
				type: "POST",
				dataType: "HTML",
				error: function(){},
				beforeSend: function(){
					
					
					
				},
				complete:function(){
					
				},
				success: function(data){
				
				
				}
	});
		
	});
});